using System.Collections.Generic;
using UnityEngine;

public class BgmRandom : MonoSingleton<BgmRandom>
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    AudioSource source;
    public List<AudioClip> bgmList=new List<AudioClip>();
    void Start()
    {
        source=GetComponent<AudioSource>();
        Next();
    }
    public void Next()
    {
        source.clip=bgmList[Random.Range(0,3)];
        source.Play();
    }
    // Update is called once per frame
    void Update()
    {
        if(!source.isPlaying)
        {
            source.Play();
        }
    }
}
